package com.elephant.core.nio;

import java.io.*;

public class FileUtils {

    public static void main(String[] args) {

        long start = System.currentTimeMillis();
        try {
            InputStream in = new FileInputStream(new File("D:\\xiaozhan\\H5\\2018-12-26\\access.log"));

            BufferedReader reader = new BufferedReader(new InputStreamReader(in));

            String line;
            int i = 1;
            while ((line = reader.readLine()) != null){

                System.out.println(i + line);
                i++;
            }
            long end = System.currentTimeMillis();

            System.out.printf("=============================================");
            System.out.printf("time :"+ ((end - start)));

            reader.close();
            in.close();

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
